<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:ctg="http://www.crotouristguide.com/taglib"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax">

<ui:component>
	<h3>#{messages['label.add.images']}</h3>
	<s:div styleClass="leftm">
		<rich:fileUpload fileUploadListener="#{dogadjajAction.processSlika}"
			maxFilesQuantity="5" listWidth="300" listHeight="300" id="upload"
			immediateUpload="false" acceptedTypes="jpg, gif, png, bmp"
			allowFlash="false" reRender="slikaList">
			<a:support event="onuploadcomplete" reRender="slikaList" />
		</rich:fileUpload>
	</s:div>
	<s:div styleClass="left">
		<rich:dataTable id="slikaList" var="s" cellpadding="0"
			styleClass="tablep" cellspacing="0"
			value="#{dogadjajAction.uneseneSlike}">
			<h:column>
				<s:graphicImage value="#{s.sadrzaj}"
					alt="#{messages['label.image.alt']}">
					<s:transformImageSize width="105" height="75" maintainRatio="false" />
				</s:graphicImage>
			</h:column>
			<!--<h:column>
							<h:selectBooleanCheckbox value="#{s.pocetna}" disabled="true"></h:selectBooleanCheckbox>
						</h:column>-->
			<h:column>
				<h:commandLink value="#{messages['label.delete']}"
					action="#{dogadjajAction.ukloniSliku(s)}"></h:commandLink>
			</h:column>
		</rich:dataTable>
	</s:div>
	<br class="clearb" />
	<br />
	<div class="navPanel" style="width: 100%;"><a:commandButton
		action="previous" value="#{messages['label.input.back']}"
		immediate="true" /> <h:panelGroup>
		<a:commandButton value="#{messages['label.submit']}"
			rendered="#{dogadjaj.idDogadjaja == null}"
			action="#{dogadjajAction.add}">
		</a:commandButton>
		<a:commandButton value="#{messages['label.submit']}"
			action="#{dogadjajAction.edit}"
			rendered="#{dogadjaj.idDogadjaja != null}">
		</a:commandButton>
		<a:commandButton value="#{messages['label.delete']}" immediate="true"
			action="#{dogadjajAction.delete}"
			rendered="#{dogadjaj.idDogadjaja != null}">
		</a:commandButton>
		<a:commandButton action="#{dogadjajAction.cancel}"
			value="#{messages['label.cancel']}" immediate="true">
		</a:commandButton>
	</h:panelGroup></div>
</ui:component>

</html>